package cn.ryh.interceptor.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Rao
 * @Description
 * @create 2022-04-16 12:56
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptorOne()).addPathPatterns("/**");

        // registry.addInterceptor(new MyInterceptorTwo()).addPathPatterns("/**");

        WebMvcConfigurer.super.addInterceptors(registry);
    }

}
